<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var s = 'http://localhost:63342/web3培训课堂代码/2%20JavaScript基础/9%20BOM/7history/pushState.html?_ijt=8hfeh1u120i463411okiqahpao';

    function mySubString(search,s){
        var pos = s.lastIndexOf('#');
        if (pos!=-1){
            s = s.slice(0,pos);
        }

        return s;
    }
//    console.log(mySubString("#",s));

    function mySubStringAfter(search,s){
        var pos = s.lastIndexOf(search);
        if (pos!=-1){
            s = s.slice(pos+1);
        } else {
            s = 0;
        }

        return s;
    }
    function getParam(search,s){
        s = mySubStringAfter('?',s);
        if (s.indexOf("=")){
            var arr = s.split("=")
            s = arr[1]

        }else {
            s = ''
        }
        return s;
    }

    var s = 'http://localhost:63342/web3%E5%9F%B9%E8%AE%AD%E8%AF%BE%E5%A0%82%E4%BB%A3%E7%A0%81/2%20JavaScript%E5%9F%BA%E7%A1%80/9%20BOM/8%20location/list.html?a=1'
    a = getParam('?',s);
    console.log(a);
</script>
</body>
</html>